//
//  CycleCell.m
//  NSURLSession轮播练习
//
//  Created by Feng on 2017/6/5.
//  Copyright © 2017年 feng. All rights reserved.
//

#import "CycleCell.h"
#import "CycleModel.h"
#import <UIImageView+WebCache.h>

@interface CycleCell ()

@property(nonatomic,weak) UIImageView *imageView;

@end

@implementation CycleCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 200)];
    
    _imageView = imageView;
    
    [self.contentView addSubview:imageView];
}

- (void)setModel:(CycleModel *)model
{
    _model = model;
    
    [_imageView sd_setImageWithURL:[NSURL URLWithString:model.img] placeholderImage:[UIImage imageNamed:@"v2_placeholder_square"]];
}

@end
